package dome1;

public class Student {
    private String name;
    private String gender;
    private int age;
    private double score;
    private static String classRoom;
    //实例代码块
    {
        this.name = "xiaohei";
        this.gender = "man";
        this.age = 18;
        this.score = 99.9;
    }

    //静态代码块
    static {
        classRoom = "318";
       // System.out.println(classRoom);
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", age=" + age +
                ", score=" + score +
                ", classRoom=" + classRoom +
                '}';
    }

    public static void main(String[] args) {
        Student student = new Student();
        System.out.println(student);
    }
}


